package com.magiccompass.alipay.barcode.entity;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

import com.magiccompass.alipay.barcode.model.AlipayBarcodeBaseRequest;
import com.magiccompass.alipay.barcode.util.DateTimeUtil;

@Entity
@Table(name = "TD_ALIPAY_BARCODE_QUERY_REQUEST")
@DynamicUpdate(value= true)
public class AlipayBarcodeQueryRequest extends AlipayBarcodeBaseRequest{
	@Id
	@Column(name = "ID")
	@GeneratedValue
	private Integer id;
	
	@OneToOne(cascade=CascadeType.ALL,fetch= FetchType.EAGER)
	@JoinColumn(name="merchant_transaction_id", nullable=false) 
	private MerchantTransaction merchantTransaction;
	
	@ManyToOne(cascade=CascadeType.REFRESH,fetch= FetchType.EAGER)
	@JoinColumn(name="merchant_id", nullable=false)
	private MerchantInfo merchant;
	
	@Column(name = "sign",length=512, nullable=true)
	private String sign;
	
	@Column(name = "create_by", nullable=false)
	private Integer createBy;
	
	@Column(name = "create_time", nullable=false)
	private Timestamp createTime = DateTimeUtil.getCurrentTimestamp();

	@Column(name = "update_by")
	private Integer updateby;

	@Column(name = "update_time")
	private Timestamp updateTime;
	
	@Column(name = "del_flag")
	private String delFlag = "F";
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getCreateBy() {
		return createBy;
	}
	public void setCreateBy(Integer createBy) {
		this.createBy = createBy;
	}
	public Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	public Integer getUpdateby() {
		return updateby;
	}
	public void setUpdateby(Integer updateby) {
		this.updateby = updateby;
	}
	public String getDelFlag() {
		return delFlag;
	}
	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}
	public MerchantTransaction getMerchantTransaction() {
		return merchantTransaction;
	}
	public void setMerchantTransaction(MerchantTransaction merchantTransaction) {
		this.merchantTransaction = merchantTransaction;
	}
	public MerchantInfo getMerchant() {
		return merchant;
	}
	public void setMerchant(MerchantInfo merchant) {
		this.merchant = merchant;
	}
	public String getSign() {
		return sign;
	}
	public void setSign(String sign) {
		this.sign = sign;
	}
	public Timestamp getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}
}